package com.wanho.qz103.hrsaas.sys.service.impl;

import com.wanho.qz103.hrsaas.commons.annontations.Autowired;
import com.wanho.qz103.hrsaas.commons.annontations.Service;
import com.wanho.qz103.hrsaas.commons.exception.DAOException;
import com.wanho.qz103.hrsaas.commons.exception.ServiceException;
import com.wanho.qz103.hrsaas.sys.dao.PermissionDAO;
import com.wanho.qz103.hrsaas.sys.pojos.Permission;
import com.wanho.qz103.hrsaas.sys.service.PermissionService;

import java.util.List;

@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDAO permissionDAO ;
    @Override
    public List<Permission> list() throws ServiceException {
        try {
            return permissionDAO.selectAll();
        } catch (DAOException e) {
            e.printStackTrace();
            throw new ServiceException("查询权限列表异常!") ;
        }
    }
}
